package com.example.mountainwalker.service.impl;

import com.example.mountainwalker.entity.ScenicFavoriteInfo;
import com.example.mountainwalker.mapper.ScenicFavoriteMapper;
import com.example.mountainwalker.service.ScenicFavoriteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScenicFavoriteImpl implements ScenicFavoriteService {

    @Autowired
    private ScenicFavoriteMapper scenicFavoriteMapper;

    @Override
    public List<ScenicFavoriteInfo> getScenicFavoriteInfo() {
        return scenicFavoriteMapper.getScenicFavoriteInfo();
    }

    @Override
    public ScenicFavoriteInfo getScenicFavoriteInfoById(Integer id) {
        return scenicFavoriteMapper.getScenicFavoriteInfoById(id);
    }

    @Override
    public int deleteScenicFavoriteInfoById(Integer id) {
        return scenicFavoriteMapper.deleteScenicFavoriteInfoById(id); // 调用Mapper的删除方法
    }

    @Override
    public int updateScenicFavoriteInfo(ScenicFavoriteInfo scenicFavoriteInfo) {
        return scenicFavoriteMapper.updateScenicFavoriteInfo(scenicFavoriteInfo);
    }
}